class_name EnemyBlackBoard  
extends StatusBlackBoard

var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
enum Direction {
	LEFT = -1,
	RIGHT = 1,
}
@export var direction := Direction.LEFT
@export var max_speed: float = 180
@export var acceleration :float = 2000
@onready var stats: Stats = $Stats

# 受伤信息
var pending_damage:Damage

func create_damage(source:Node2D, hurt_amount:int, type:int =1 ) -> Damage:
	pending_damage = Damage.new()
	pending_damage.source = source
	pending_damage.amount = hurt_amount
	pending_damage.type = type
	return pending_damage
	
func get_damage() -> Damage:
	return pending_damage
	
func has_damage() -> bool:
	return pending_damage != null
	
func free_damage() ->void:
	pending_damage = null
	

# 状态栏
func get_stats() -> Stats:
	return stats
func update_health(v:int)->int:
	stats.health -= v
	return stats.health
	
func get_health()->int:
	return stats.health
